<!-- 总布局容器 -->
<template>
  <TopNavVue />

  <!-- 头部组件 -->
  <HeaderVue />

  <!-- 头部吸顶组件 -->
  <HeaderStickyVue />

  <main class="app-body">
    <!-- 二级路由 -->
    <router-view></router-view>
  </main>

  <FooterVue />
</template>

<script>
import { defineComponent, ref, onMounted } from 'vue'
import TopNavVue from '@/components/topNav.vue'
import HeaderVue from '@/components/header.vue'
import FooterVue from '@/components/footer.vue'
import HeaderStickyVue from '@/components/header-sticky.vue'
import { useStore } from 'vuex'

export default defineComponent({
  name: "Layout",

  setup() {
    const store = useStore()
    //初始化时获取目录
    store.dispatch('category/getList')


    return {
      store,
    }
  },
  components: {
    TopNavVue,
    HeaderVue,
    FooterVue,
    HeaderStickyVue
  }
})
</script>

<style lang="less" scoped>
.app-body {
  min-height: 600px;
}
</style>